import { getAction, putAction } from '@/api/manage'
import { serviceApi } from '@/api/common.js'

/**
 * 公共API接口
 */
export const api = {
  list: (tenantId) => serviceApi.auth + `/tenants/${tenantId}/users`,
  delete: (userId, tenantId) => serviceApi.auth + `/tenants/${tenantId}/users/${userId}`
}

/**
 * 部门树列表
 * @param {*} params
 * @returns
 */
export const queryTreeByTenantId = (tenantId, params) => getAction(serviceApi.auth + `/departs/tenants/${tenantId}/ids`, params);

/**
 * 更新租户用户状态
 * @param {*} userId
 * @param {*} tenantId
 * @param {*} params
 * @returns
 */
export const updateTenantUserStatus = (tenantId, userId, params) => putAction(serviceApi.auth + `/tenants/${tenantId}/users/${userId}/status`, params);
